package com.kancy.demo.spring.boot.drools.controller;

import com.kancy.spring.boot.drools.service.LocalDroolsRuleEngine;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * TestController
 * <p>
 *
 * @author: kancy
 * @date: 2020/3/14 16:13
 **/
@Slf4j
@RequiredArgsConstructor
@RestController
public class TestController {

    private final LocalDroolsRuleEngine ruleEngine;

    @GetMapping("/test")
    public String test(){
        ruleEngine.session("demo-session")
                .insert("Hello")
                .call();
        return "ok";
    }
}
